//电影详细页面
$(function(){
    $.ajax({
        type:'get',
        url:'http://api.douban.com/v2/movie/subject/'+localStorage.movieId,
        dataType:'jsonp',
        success:function(data){
            console.log(data);


            $("#movieImg")[0].src = data.images.large;
            $("#title")[0].innerHTML = data.title;
            $("#summary")[0].innerHTML = data.summary;
            var mainStars = '';//主演
            for(var i = 0; i < data.casts.length; i++){
                mainStars += data.casts[i].name + " ";

            }
            $("#avatars")[0].innerHTML = '主演：' + mainStars;

            localStorage.movieId = '';
        },
        error:function(err){
            console.log("读取详细信息失败了");
        }
    })
})